import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    username: '',
    productsList: null,
    productsCount: 0,
    token: ''
  },
  mutations: {
    saveusername(state, username){
      state.username = username;
    },
    saveproducts(state, list){
      state.productsList = list
    },
    saveProductsCount(state, count){
      state.productsCount = count
    },
    saveToken(state, token){
      state.token = token;
    }
  },
  actions: {
  },
  modules: {
  }
})
